package com.elong.spring.advice;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;


public class GreetingInterceptor implements MethodInterceptor{

    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
	//获取入参
	Object[] args = invocation.getArguments();
	String clientName = (String) args[0];
	System.out.println("How are you! Mr." + clientName + ".");
	
	//执行方法
	Object obj = invocation.proceed();
	
	System.out.println("please enjoy yoursele");
	return obj;
    }

}
